package cn.lanqiao.business.service.impl;

import java.util.List;
import cn.lanqiao.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.lanqiao.business.mapper.GroupsManagementMapper;
import cn.lanqiao.business.domain.GroupsManagement;
import cn.lanqiao.business.service.IGroupsManagementService;

/**
 * 小组信息Service业务层处理
 * 
 * @author zongzi
 * @date 2024-07-08
 */
@Service
public class GroupsManagementServiceImpl implements IGroupsManagementService 
{
    @Autowired
    private GroupsManagementMapper groupsManagementMapper;

    /**
     * 查询小组信息
     * 
     * @param id 小组信息主键
     * @return 小组信息
     */
    @Override
    public GroupsManagement selectGroupsManagementById(Long id)
    {
        return groupsManagementMapper.selectGroupsManagementById(id);
    }

    /**
     * 查询小组信息列表
     * 
     * @param groupsManagement 小组信息
     * @return 小组信息
     */
    @Override
    public List<GroupsManagement> selectGroupsManagementList(GroupsManagement groupsManagement)
    {
        return groupsManagementMapper.selectGroupsManagementList(groupsManagement);
    }

    /**
     * 新增小组信息
     * 
     * @param groupsManagement 小组信息
     * @return 结果
     */
    @Override
    public int insertGroupsManagement(GroupsManagement groupsManagement)
    {
        groupsManagement.setCreateTime(DateUtils.getNowDate());
        return groupsManagementMapper.insertGroupsManagement(groupsManagement);
    }

    /**
     * 修改小组信息
     * 
     * @param groupsManagement 小组信息
     * @return 结果
     */
    @Override
    public int updateGroupsManagement(GroupsManagement groupsManagement)
    {
        groupsManagement.setUpdateTime(DateUtils.getNowDate());
        return groupsManagementMapper.updateGroupsManagement(groupsManagement);
    }

    /**
     * 批量删除小组信息
     * 
     * @param ids 需要删除的小组信息主键
     * @return 结果
     */
    @Override
    public int deleteGroupsManagementByIds(Long[] ids)
    {
        return groupsManagementMapper.deleteGroupsManagementByIds(ids);
    }

    /**
     * 删除小组信息信息
     * 
     * @param id 小组信息主键
     * @return 结果
     */
    @Override
    public int deleteGroupsManagementById(Long id)
    {
        return groupsManagementMapper.deleteGroupsManagementById(id);
    }

    /**
     * 通过班级id查询小组信息
     *
     * @param classId 班级id
     * @return 小组信息
     */
    @Override
    public List<GroupsManagement> selectGroupsManagementsByClassId(Long classId) {
        return groupsManagementMapper.selectGroupsManagementsByClassId(classId);
    }
}
